package com.zui.entity.product;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.zui.entity.BaseAutoIdEntity;

@Entity
@Table(name="product_category",
uniqueConstraints={@UniqueConstraint(name="uc_product_category",
		columnNames={"productId", "categoryId","fromDate"})})
public class ProductCategory extends BaseAutoIdEntity{
	
	private static final long serialVersionUID = 1L;
	private Date fromDate;
	private Date ThruDate;
	private String primaryFlag = FLAG_N;
	
	private Product product;
	private Category Category;
	private Integer sequenceNum;
	
	
	public Date getFromDate() {
		return fromDate;
	}
	public Date getThruDate() {
		return ThruDate;
	}
	@Column(length=1)
	public String getPrimaryFlag() {
		return primaryFlag;
	}
	@ManyToOne() @JoinColumn(name="productId")
	public Product getProduct() {
		return product;
	}
	@ManyToOne() @JoinColumn(name="categoryId")
	public Category getCategory() {
		return Category;
	}
	public Integer getSequenceNum() {
		return sequenceNum;
	}
	
	
	public void setSequenceNum(Integer sequenceNum) {
		this.sequenceNum = sequenceNum;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public void setThruDate(Date thruDate) {
		ThruDate = thruDate;
	}
	
	public void setPrimaryFlag(String primaryFlag) {
		this.primaryFlag = primaryFlag;
	}
	
	public void setProduct(Product product) {
		this.product = product;
	}
	
	public void setCategory(Category category) {
		Category = category;
	}

	
	
}
